import java.util.LinkedList;

public class Test {
    public static void main(String[] args) {
        LinkedList<String> queue =new LinkedList<>();
      /*queue.addLast("1");
      queue.addLast("2");
      queue.addLast("3");
      queue.addLast("4");
      queue.addLast("5");
     // System.out.println(queue);
        System.out.println(queue.removeFirst());
        System.out.println(queue.removeFirst());
        System.out.println(queue.removeFirst());
        System.out.println(queue.removeFirst());
        System.out.println(queue.removeFirst());
*/
        queue.push("1");
        queue.addFirst("2");
        queue.addFirst("3");
        queue.addFirst("4");
        System.out.println(queue.pop());
        System.out.println(queue.removeFirst());
        System.out.println(queue.removeFirst());
        System.out.println(queue.removeFirst());

    }
}
